<?php

//防止恶意调用
if (!defined('IN_MOD'))
{
    die('Hacking attempt');
}

if($setblock == "detail")
{
	// TAG标签
	$taglist_news = configmodule("zcj_news",155,0,'pacid',"status=1",'sort desc, aid desc');
	$taglist_news = seorighttablist($taglist_news);
	$this->assign('taglist_new', $taglist_news);
	if($article['taglist'])
	{
		$article['taglist'] = substr($article['taglist'],0,strlen($article['taglist'])-1); 
		$taglist = explode(",", $article['taglist']);
		foreach($taglist as $k=>$v)
		{
			$taglists[$k]['title'] = $v;
			$taginfo = seotaginfo('zcj_news',155,'pacid',$v,'atitle');
			$taglists[$k]['tagid'] = $taginfo['aid'];
		}
		$this->taglist = $taglists;
	}
}

if($setblock == "where")
{
	// 资讯动态-TAG标签
	if($_GET['tagid'])
	{
		$taginfo = datainfo('zcj_news',$_GET['tagid'],'aid');
		$where .= " and taglist like '%".trim($taginfo['atitle'])."%'";
	}
}

if($setblock == "list")
{
	foreach ($news['field1'] as $key => $value) {	
		// TAG标签
		if($value['taglist'])
		{
			$value['taglist'] = substr($value['taglist'],0,strlen($value['taglist'])-1); 
			$taglist = explode(",", $value['taglist']);
			foreach($taglist as $k=>$v)
			{
				$taglists[$k]['title'] = $v;
				$taglistinfo = seotaginfo('zcj_news',155,'pacid',$v,'atitle');
				$taglists[$k]['tagid'] = $taglistinfo['aid'];
			}
			$news['field1'][$key]['taglists'] = $taglists;
		}
		
	}	
	$this->assign('news',$news);
	
	// TAG标题SEO
	if($_GET['tagid'])
	{
		$hometag = "资讯动态";
		$this->headmeta = seoheadtag($this->headmeta['title'],$this->headmeta['keyword'],$this->headmeta['description'],$hometag,$taginfo['atitle']);
	}
	
	// 最新标签
	$taglist_news = configmodule("zcj_news",155,0,'pacid',"status=1",'sort desc, aid desc');
	$taglist_news = seorighttablist($taglist_news);
	$this->assign('taglist_new', $taglist_news);
}

if($setblock == "tagmodule")
{
	// 最新TAG标签
	$taglist_new = configmodule("zcj_news",$this->configinfo['modulecolumn'],0,'pacid',"status=1",'sort desc, aid desc','',200);
	$taglist_new = seorighttablist($taglist_new);
	$this->assign('taglist_new', $taglist_new);
	
	// 热门TAG标签
	$tagclass3 = getbottomclass1("zcj_newsclasses",3,'acid','classid',1);
	$taglist_hot = seohottaglist("zcj_news",$this->configinfo['modulecolumn'],'pacid','aid',$tagclass3,'sort desc, aid desc');
	$taglist_hot = seorighttablist($taglist_hot);
	$this->assign('taglist_hot', $taglist_hot);
	
	// 推荐TAG标签
	$taglist_best = configmodule("zcj_news",$this->configinfo['modulecolumn'],0,'pacid',"type=1 and status=1",'sort desc, aid desc','',60);
	$taglist_best = seorighttablist($taglist_best);
	$this->assign('taglist_best', $taglist_best);	
}
?>